import Vue from 'vue';
import Router from 'vue-router';
import '@/assets/sass/reset.css';
const main = r => require.ensure([], () => r(require('../page/main')));
const login = r => require.ensure([], () => r(require('../page/login')));
const singup = r => require.ensure([], () => r(require('../page/singup')));
// 个人中心
const userPage = r => require.ensure([], () => r(require('../page/user')));
const email = r => require.ensure([], () => r(require('../page/user/email')));
const bank = r => require.ensure([], () => r(require('../page/user/bank')));
const wechat = r => require.ensure([], () => r(require('../page/user/wechat')));
const alipay = r => require.ensure([], () => r(require('../page/user/alipay')));
const pass = r => require.ensure([], () => r(require('../page/user/pass')));
const passChange = r => require.ensure([], () => r(require('../page/user/pass-change')));
const tradePass = r => require.ensure([], () => r(require('../page/user/trade-pass')));
const phone = r => require.ensure([], () => r(require('../page/user/phone')));
const phoneChange = r => require.ensure([], () => r(require('../page/user/phone-change')));
const realname = r => require.ensure([], () => r(require('../page/user/realname')));

// 资讯
const msg = r => require.ensure([], () => r(require('../page/msg/list')));
const msgDetail = r => require.ensure([], () => r(require('../page/msg/detail')));

// c2c
const c2c = r => require.ensure([], () => r(require('../page/c2c')));
const c2cList = r => require.ensure([], () => r(require('../page/c2c/list')));
const c2cDetail = r => require.ensure([], () => r(require('../page/c2c/detail')));
const c2cAdvert = r => require.ensure([], () => r(require('../page/c2c/advert')));

// 资产
const asset = r => require.ensure([], () => r(require('../page/asset')));
const assetList = r => require.ensure([], () => r(require('../page/asset/list')));
const assetRecharge = r => require.ensure([], () => r(require('../page/asset/recharge')));
const assetWithdraw = r => require.ensure([], () => r(require('../page/asset/withdraw')));
const assetRecord = r => require.ensure([], () => r(require('../page/asset/record')));
const assetRecordDetail = r => require.ensure([], () => r(require('../page/asset/record-detail')));
// 管理
const manage = r => require.ensure([], () => r(require('../page/manage')));
const manageEntrust = r => require.ensure([], () => r(require('../page/manage/entrust')));
const manageOrder = r => require.ensure([], () => r(require('../page/manage/order')));

// 币币
const coins = r => require.ensure([], () => r(require('../page/coins')));
const coinsList = r => require.ensure([], () => r(require('../page/coins/list')));
const coinsDetail = r => require.ensure([], () => r(require('../page/coins/detail')));

Vue.use(Router);
console.log(main);
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'main',
      component: main
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/singup',
      name: 'singup',
      component: singup
    },
    {
      path: '/',
      name: 'user',
      component: userPage,
      children: [
        {
          path: '/user/email',
          name: 'user_email',
          component: email
        },
        {
          path: '/user/bank',
          name: 'user_bank',
          component: bank
        },
        {
          path: '/user/wechat',
          name: 'user_wechat',
          component: wechat
        },
        {
          path: '/user/alipay',
          name: 'user_alipay',
          component: alipay
        },
        {
          path: '/user/pass',
          name: 'user_pass',
          component: pass
        },
        {
          path: '/user/pass/change',
          name: 'user_pass_change',
          component: passChange
        },
        {
          path: '/user/trade',
          name: 'user_trade',
          component: tradePass
        },
        {
          path: '/user/phone',
          name: 'user_phone',
          component: phone
        },
        {
          path: '/user/phone/change',
          name: 'user_phone_change',
          component: phoneChange
        },
        {
          path: '/user/realname',
          name: 'user_realname',
          component: realname
        }
      ]
    },
    {
      path: '/msg',
      name: 'msg_list',
      component: msg
    },
    {
      path: '/msg/detail',
      name: 'msg_detail',
      component: msgDetail
    },
    {
      path: '/c2c',
      name: 'c2c',
      component: c2c,
      children: [
        {
          path: '/c2c',
          name: 'c2c_list',
          component: c2cList
        },
        {
          path: '/c2c/detail',
          name: 'c2c_detail',
          component: c2cDetail
        },
        {
          path: '/c2c/advert',
          name: 'c2c_advert',
          component: c2cAdvert
        }
      ]
    },
    {
      path: '/asset',
      name: 'asset',
      component: asset,
      children: [
        {
          path: '/asset',
          name: 'asset_list',
          component: assetList
        },
        {
          path: '/asset/recharge',
          name: 'asset_recharge',
          component: assetRecharge
        },
        {
          path: '/asset/withdraw',
          name: 'asset_withdraw',
          component: assetWithdraw
        },
        {
          path: '/asset/record',
          name: 'asset_record',
          component: assetRecord
        },
        {
          path: '/asset/record/detail',
          name: 'asset_record_detail',
          component: assetRecordDetail
        }
      ]
    },
    {
      path: '/manage',
      name: 'manage',
      component: manage,
      children: [
        {
          path: '/manage',
          name: 'manage_entrust',
          component: manageEntrust
        },
        {
          path: '/manage/order',
          name: 'manage_order',
          component: manageOrder
        }
      ]
    },
    {
      path: '/coins',
      name: 'coins',
      component: coins,
      children: [
        {
          path: '/coins',
          name: 'coins_list',
          component: coinsList
        },
        {
          path: '/coins/detail',
          name: 'coins_detail',
          component: coinsDetail
        }
      ]
    }
  ]
});